import request from '@/utils/request'

// 查询原料消耗记录列表
export function listConsumption(query) {
  return request({
    url: '/productionMat/consumption/list',
    method: 'get',
    params: query
  })
}

// 查询原料消耗记录列表(分页)
export function pageConsumption(query) {
  return request({
    url: '/productionMat/consumption/page',
    method: 'get',
    params: query
  })
}

// 查询原料消耗记录详细
export function getConsumption(id) {
  return request({
    url: '/productionMat/consumption/get/' + id,
    method: 'get'
  })
}

// 新增原料消耗记录
export function addConsumption(data) {
  return request({
    url: '/productionMat/consumption/add',
    method: 'post',
    data: data
  })
}

// 修改原料消耗记录
export function updateConsumption(data) {
  return request({
    url: '/productionMat/consumption/edit',
    method: 'post',
    data: data
  })
}

// 删除原料消耗记录
export function delConsumption(id) {
  return request({
    url: '/productionMat/consumption/remove/' + id,
    method: 'post'
  })
}


export function getMatrialName(query) {
  return request({
    url: '/productionMat/consumption/getMatrialName',
    method: 'get',
    params: query
  })
}

export function getHisMatrialByDate(query) {
  return request({
    url: '/productionMat/consumption/getHisMatrialByDate',
    method: 'get',
    params: query
  })
}

export function getCurrMatrial(query) {
  return request({
    url: '/productionMat/consumption/getCurrMatrial',
    method: 'get',
    params: query
  })
}
